package controllers;

import java.util.List;

import models.DriverJourney;
import models.Journey;
import models.User;
import play.modules.paginate.ValuePaginator;
import play.mvc.With;

import common.FBSecure;

@With(FBSecure.class)
public class Profile extends FBController {
	
	public static void profile(long id) {
		setFbIdandName();

		User user = getUser();
		
		User profileUser = User.findById(id);
		
		List<Journey> journeyList = profileUser.getJourneyList();
		
		ValuePaginator paginator = new ValuePaginator(journeyList);
		paginator.setPageSize(5);
		
		render(user, profileUser, journeyList, paginator);
	}

}
